Skip to content

fix: 5592 surface IPFS errors during profile setup#5993

Merged
Pyatakov merged 3 commits intodevelopfrom
fix/sr-profile-ipfs-error
Apr 24, 2026
Merged

fix: 5592 surface IPFS errors during profile setup#5993
Pyatakov merged 3 commits intodevelopfrom
fix/sr-profile-ipfs-error

Conversation

@Pyatakov
Copy link
Copy Markdown
Contributor

Description

Fixes two user-visible failure modes when IPFS is misconfigured:

  1. UI hangs indefinitely at "Publish DID Document" with no error surfaced.
  2. Misleading MISSING_PROPERTIES_IN_CONTEXT JSON-LD error that hides the real cause.

Four chained defects are addressed:

  • IpfsClientClass dereferences an uninitialized client. Added assertClientReady() guard on addFile / deleteCid so a failed client init produces a readable error instead of TypeError: Cannot read properties of undefined (reading 'uploadFile'). The worker process is intentionally kept alive so per-tenant misconfiguration in multi-tenant forks doesn't take the whole worker down.
  • queue-service suppressed TASK_COMPLETE for user-facing tasks. Removed two if (!task.interception) guards so terminal failures always publish the completion event. Every call site that sets interception already pairs with registerCallback: true, and no alternate completion path exists, the guards were dormant-bug code. Awaiting Promises in addRetryableTask / addNonRetryableTask now reject instead of hanging.
  • createSystemSchemas swallowed publish errors. Rethrow instead of returning null. The null return is now reserved for the legitimate "no entity schema" case. A fail-fast guard in createUserProfile now throws System schema for entity "X" not found. when the template is missing, rather than signing a VC without @context.
  • DID publish step silently swallowed its own error. Rethrow so profile setup aborts at the failing step instead of cascading through schema publishing and VC creation with corrupt state.

Related issue(s):

Fixes #5992

Notes for reviewer:

  • worker-service/src/api/ipfs-client-class.tsassertClientReady() guard added to addFile and deleteCid.
  • queue-service/src/queue-service/queue-service.ts – removed !task.interception guards in the TASK_COMPLETE handler.
  • guardian-service/src/api/helpers/profile-helper.ts – rethrow in createSystemSchemas, rethrow on DID publish failure, fail-fast guard before VC signing.

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

createSystemSchemas was swallowing publish failures and returning null, which caused createUserProfile to sign a VC without an @context and fail with a misleading MISSING_PROPERTIES_IN_CONTEXT JSON-LD error. Rethrow the original error and fail fast with an actionable message pointing at IPFS provider credentials when the SR entity schema is missing.

Signed-off-by: Alex Piatakov <alex.piatakov@swirldslabs.com>
Signed-off-by: Alex Piatakov <alex.piatakov@swirldslabs.com>
Signed-off-by: Alex Piatakov <alex.piatakov@swirldslabs.com>
@Pyatakov Pyatakov requested review from a team as code owners April 24, 2026 16:54
@Pyatakov Pyatakov self-assigned this Apr 24, 2026
@github-actions
Copy link
Copy Markdown

Test Results

 32 files  ±0   64 suites  ±0   8m 14s ⏱️ -24s
 35 tests ±0   35 ✅ +1  0 💤 ±0  0 ❌  - 1 
165 runs  ±0  165 ✅ +1  0 💤 ±0  0 ❌  - 1 

Results for commit d7c7b23. ± Comparison against base commit b6490d3.

@Pyatakov Pyatakov merged commit 6662e85 into develop Apr 24, 2026
23 of 26 checks passed
@Pyatakov Pyatakov deleted the fix/sr-profile-ipfs-error branch April 24, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant